#TODO: Only run in signup.html like it's supposed to
#$ ->
#  # Add all languages and classes to the appropriate combo boxes
#  #   languages is set in HAML page
#  $.each languages, (i) ->
#    $('#langselect').append('<option name="'+languages[i][0]+'">'+languages[i][1]+'</option>')
#  $.each classes, (i) ->
#    $('#classselect').append('<option name="'+classes[i]+'">'+classes[i]+'</option>')
#  # Show error message for invalid form elements (by hovering the red circle on the right)
#  $('td.error div').mouseenter ->
#    if $(this).parent().hasClass('error')
#      id = "#" + $(this).parent().attr("id") + "error"
#      $(id).fadeIn()
#  $('td.error div').mouseleave ->
#    if $(this).parent().hasClass('error')
#      id = "#" + $(this).parent().attr("id") + "error"
#      $(id).fadeOut()
#  # Perform signup
#  $('#submitbtn').click ->
#    if $('#passinput').val() != $('#pass2input').val()
#      alert("Your passwords need to match!")
#      return
#    $.post '/signup/individual.json', {
#      v: true, u: $('#userinput').val(), p: sha256_digest($('#passinput').val()), r: $('#nameinput').val(),
#      e: $('#emailinput').val(), l: $('#langselect').val(), c: $('#classselect').val(), o: $('#codeinput').val()
#    }, (data) ->
#      alert("Got JSON!")
#      console.log(data)
